import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: () => import("@/views/Main.vue"),
    name:'首页1',
    redirect: "/index",
    children: [
      {
        path: "/index",
        component: () => import("@/views/Index.vue"),
        name:'首页',
        redirect: "/index2",
        children: [
          {
            path: "/index2",
            component: () => import("@/views/Index2.vue"),
            name:'主页面',
          },
          {
            path: "/LingPage1",
            component: () => import("@/views/LingPage1.vue"),
          },
          {
            path: "/LingPage2",
            component: () => import("@/views/LingPage2.vue"),
          },
          {
            path: "/LingPage3",
            component: () => import("@/views/LingPage3.vue"),
          },
          {
            path: "/WangPage1",
            component: () => import("@/views/WangPage1.vue"),
          },
          {
            path: "/WangPage2",
            component: () => import("@/views/WangPage2.vue"),
          },
          {
            path: "/WangPage3",
            component: () => import("@/views/WangPage3.vue"),
          },
          {
            path: "/YangPage1",
            component: () => import("@/views/YangPage1.vue"),
            redirect: "/YangHandler/1",
            name:'商品管理',
            children: [
              {
                path: "/YangHandler/:id",
                component: () => import("@/views/YangHandler.vue"),
                name:'商品上架',
              },
            ]
          },
          {
            path: "/YangPage2",
            component: () => import("@/views/YangPage2.vue"),
            name:'商品详情',
          },
          {
            path: "/YangPage3",
            component: () => import("@/views/YangPage3.vue"),
            name:'添加商品',
          },
          {
            path: "/ZhangPage1",
            component: () => import("@/views/ZhangPage1.vue"),
          },
          {
            path: "/ZhangPage2",
            component: () => import("@/views/ZhangPage2.vue"),
          },
          {
            path: "/ZhangPage3",
            component: () => import("@/views/ZhangPage3.vue"),
          },

          
        ],
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
